Question: 1 -
Which of the following can be operands of arithmetic operators?
-
Both Numeric & Characters
-
Characters
-
Numeric
-
Boolean
Answer:
Both Numeric & Characters
Solution:
The operand of arithmetic operators can be any of numeric or character type, But not boolean.
The operand of arithmetic operators can be any of numeric or character type, But not boolean.
Question: 2 -
Decrement operator, −−, decreases the value of variable by what number?
-
3
-
4
-
1
-
2
Answer:
1
Solution not available.
Question: 3 -
Can 8 byte long data type be automatically type cast to 4 byte float data type?
-
FALSE
-
can not say
-
Can be true or false
-
TRUE
Answer:
TRUE
Solution:
Both data types have different memory representation that is why 8-byte integral data type can be stored to 4-byte floating point data type.
Both data types have different memory representation that is why 8-byte integral data type can be stored to 4-byte floating point data type.
Question: 4 -
Modulus operator, %, can be applied to which of these?
-
Both Integers and floating - point numbers
-
Integers
-
Floating - point numbers
-
None of the mentioned
Answer:
Both Integers and floating - point numbers
Solution:
Modulus operator can be applied to both integers and floating point numbers.
Modulus operator can be applied to both integers and floating point numbers.
Question: 5 -
Which of these statements are incorrect?
-
Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms
-
Assignment operators can be used only with numeric and character data type
-
Assignment operators run faster than their equivalent long forms
-
None of the mentioned
Answer:
None of the mentioned